package com.linkturing.swing;

import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;

import com.linkturing.util.Constants;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class AddWeightSetting extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	public static JScrollPane scrollPane ;
	public static AddWeightDataTable dataTable = null;
	public static JTable table;
	JFrame frame = null;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				try {
					AddWeightSetting frame = new AddWeightSetting();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public AddWeightSetting() {
		
		frame = this;
		//加重范围设置
		setTitle("\u52A0\u91CD\u8303\u56F4\u8BBE\u7F6E");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setBounds(200, 150, 886, 419);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 0, 304, 57);
		contentPane.add(panel);
		panel.setLayout(null);

		//新增
		JButton btnNewButton = new JButton("\u65B0\u589E");
		btnNewButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				AddWeightSettingNew add = new AddWeightSettingNew();
				add.setVisible(true);
				add.setAlwaysOnTop(true);
			}
		});
		btnNewButton.setBounds(10, 10, 93, 37);
		panel.add(btnNewButton);
		
		scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 62, 823, 308);
		contentPane.add(scrollPane);
		
		dataTable = new AddWeightDataTable("",frame);
		dataTable.reloadTable(Constants.addweightSetting);
	}
}
